package com.example.agent;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DynamicChenNonging implements InvocationHandler {
    private Object obj;

    public DynamicChenNonging(Object obj) {
        this.obj = obj;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object result = method.invoke(obj, args);
        if(method.getName().equals("buy")){
            System.out.println("YangGuiZhong在648");
        }
        return result;
    }
}
